﻿{% extends "base.html" %}
{% block title %} 历史订单列表 {% endblock %}

{% block content %}
<div>
<form id="form1">
<label style="font-size:20px">订单号:</label>
<input type="text" name="token" value="{{today}}" id ="token" style="border:1px solid #000000;border-top-style:none;border-left-style:none;border-right-style:none;width:120px;font-size:20px;" />
<input type="button" value="新建订单" id="newTokenBtn" name="newTokenBtn" onclick="newToken()" style="font-size:25px;" />
<br />
<span style="font-size:15px; color:red">[新建订单]前可指定任意订单号,默认为当天日期</span>
</div>
</form>
<script type="text/javascript">	
	function newToken() {		
		//alert(tokenToday);		
		window.location.href="/ebpform/" + $("#token").val();		
	}
</script>

<table border="1" cellspacing="0" cellpadding="0" style="font-size:20px">
<tr>
	<th>订单号</th>
	<th>次数</th>
	<th>创建日期</th>
	<th>删除</th>
</tr>
{% for item in tokens %}
<tr>
	<td style="font-size:30px">&nbsp;<a href="/ebpform/{{item.token}}">{{item.token}}</a>&nbsp;</td>
	<td align="center">{{item.times}}</td>	
	<td>{{item.cre_date|date:'m/d/Y'}}</td>
	<td>&nbsp;<a href="/ebp/delete/{{item.token}}" onclick="return deleteEbp({{item.token}})">删除</a>&nbsp;</td>
</tr>

{% endfor %}

</table>

<input type="button" value=" 注 销 " onclick="logout()" style="font-size:25px;" />
<script type="text/javascript">
	function logout() {
		window.location.href = "/logout/"
	}
	function deleteEbp(token) {
		cont = confirm("您确认要删除订单号["+token+"]");
		return cont;
	}
</script>
{% endblock %}